import axios from 'axios'
const baseURL = "http://www.lovegf.cn:8899"
/* const baseURL = 'http://www.lovegf.cn:8888/api/private/v1/' */
axios.defaults.baseURL = baseURL;
//轮播图
export const getlunbo = ()=>{
    return axios.get('/api/getlunbo')
}
//新闻列表
export const getlist = ()=>{
    return axios.get('/api/getnewslist')
}
//新闻详情
export const getnewsinfo = (id)=>{
    return axios.get(`/api/getnew/${id}`)
}
//评论列表
export const getcomments = (artid,pageindex)=>{
    return axios(`/api/getcomments/${artid}?pageindex=${pageindex}`)
}
//发表评论
export const postcomments = (artid,content)=>{
    return axios.post(`/api/postcomment/${artid}`,{artid,content})
}
//图片分类
export const getimgcategory = ()=>{
    return axios('/api/getimgcategory')
}
//图片列表
export const getimages = (id)=>{
    return axios('/api/getimages/'+ id)
}
//图片详情
export const getimageInfo = (id)=>{
    return axios('/api/getimageInfo/'+id)
}
//商品列表
export const getgoods = ()=>{
    return  axios('/api/getgoods?pageindex=1')
}
//商品详情
export const goodsgetinfo = (id)=>{
    return axios('/api/goods/getinfo/'+id)
}
//商品图文列表
export const getgoodsinfo = (id)=>{
    return axios('/api/goods/getdesc/'+id)
}
/* 获取购物车列表数据 */
export const  getGoodsList= params => {
    return axios.get(`/api/goods/getshopcarlist/${params}`)
}
//缩略图片
export const getthumimages = (imgid)=>{
    return axios('/api/getthumimages/'+imgid)
}